package cn.rkylin.oms.salespromotion.rules.dao;

import java.util.HashMap;
import java.util.List;

import cn.rkylin.oms.salespromotion.rules.domain.SalesPromotionRule;
import cn.rkylin.oms.salespromotion.rules.vo.SalesPromotionRuleVO;

/**
 * 促销规则访问对象
 * @author zhanghao
 *
 */
public interface ISalesPromotionRuleDAO {
    /**
     * 新增促销规则
     * @param ruleVO
     * @return 
     * @throws Exception
     */
    public int insertSalesPromotionRule(SalesPromotionRule rule) throws Exception;
    /**
     * 更新促销规则
     * @param ruleVO
     * @return 
     * @throws Exception
     */
    public int updateSalesPromotionRule(SalesPromotionRule rule) throws Exception;
    
    /**
     * 根据促销删除促销规则
     * @param ruleId
     * @return
     * @throws Exception
     */
    public int deleteSalesPromotionRuleById(String ruleId) throws Exception;
    /**
     * 获取各个状态下的规则的数值
     * @param queryParamVO 
     * @return
     * @throws Exception 
     */
    @SuppressWarnings("rawtypes")
    public List<HashMap> selectStateCount(SalesPromotionRuleVO queryParamVO) throws Exception;
    /**
     * selectAvailableRule:根据查询条件获取订单满足的促销规则列表. <br/>
     *
     * @author zhanghao
     * @param queryParam
     * @return
     * @throws Exception 
     */
    public List<SalesPromotionRuleVO> selectAvailableRule(SalesPromotionRuleVO queryParam) throws Exception;
    /**
     * selectDuplicatedRule:获取重复的规则. <br/>
     *
     * @author zhanghao
     * @param ruleVO
     * @return
     * @throws Exception 
     */
    public List<SalesPromotionRuleVO> selectDuplicatedRule(SalesPromotionRuleVO ruleVO) throws Exception;
}
